jQuery(document).ready(function() {
     var footerHeight = 0,
           footerTop = 0,
           $footer = $(".footer");
           
       positionFooter();

       
       function positionFooter() {
       
                footerHeight = $footer.height();
                footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
               if ( ($('.page-content').height()+ footerHeight) < $(window).height()) {
                   $footer.css({
                        position: "absolute"
                   }).animate({
                        top: footerTop
                   });
               } else {
                   $footer.css({
                        position: "static"
                   });
               }
               
       }

        $(window).on('resize',function(){positionFooter();});
    // binds form submission and fields to the validation engine
     $('form#formRecovery,form#formNewPassword').ajaxFormSubmitCodeigniter();  
 });

